package com.app.jzgdirector.base.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;

import com.app.jzgdirector.common.service.AppManager;
import com.app.jzgdirector.common.util.ToastUtils;

import butterknife.ButterKnife;

/**
 * Created by80002037 on 2017/3/31 11:42.
 */

public abstract class BaseActivity extends BaseToolBarActivity {
    public static final String TAG="BaseActivity";
    protected ToastUtils toastUtils;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i(TAG,"onCreate");
        AppManager.getAppManager().addActivity(this);
        setContentView(layoutId());
        ButterKnife.bind(this,root);
        toastUtils=new ToastUtils(this);
        initView();
        initFileds();
        initEvents();
    }
    protected abstract int layoutId();
    protected void initView() {

    }
    protected void initFileds() {

    }
    protected void initEvents() {

    }
    @Override
    protected void onDestroy() {
        Log.i(TAG, "onDestroy");
        AppManager.getAppManager().removeActivity(this);
        super.onDestroy();
    }

}
